<?php

class TestController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| Default Home Controller
	|--------------------------------------------------------------------------
	|
	| You may wish to use controllers instead of, or in addition to, Closure
	| based routes. That's great! Here is an example controller method to
	| get you started. To route to this controller, just add the route:
	|
	|	Route::get('/', 'HomeController@showWelcome');
	|
	*/

	public function getIndex()
	{
        //测试开通账 户
        $service = new SelfMemberService();
        $service->createMember();
        $member = Member::find(1);
//        $memberAccount = new MemberAccount();
//        $memberAccount->addAccount($member->id);
//
//        echo $memberAccount->getMemberAccountLeft($member->id);
//        $memberAccount->income($member->id, 0.01, MemberAccount::INTEGRAL_ACCOUNT);
//        var_dump($memberAccount->errors());

        $order = Order::find(1);
        $orderService = new OrderService($order);
        var_dump($orderService->settle(MemberAccount::INTEGRAL_ACCOUNT));
		return View::make('hello');
	}

}
